﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WebPattern.Core.Extensions
{
    public static class ByteArrayComparer
    {
        public static bool AreEqual(byte[] x, byte[] y)
        {

            if (x == null || y == null)
                return false;

            if (ReferenceEquals(x, y))
                return true;

            if (x.Length != y.Length)
                return false;

            for (int i = 0; i < x.Length; i++)
            {
                if (x[i] != y[i])
                    return false;
            }

            return true;
        }
    }
}
